package wild.horse.iwardrobe.utils;

import android.util.Log;

public class LogUtils {

	public static String TAG = "LogUtils";
	public static int logLevel = Log.VERBOSE;

	public static void e(String tag, String msg) {
		if (logLevel <= Log.ERROR) {
			Log.e(tag, msg);
		}
	}

	public static void e(String tag, String msg, Throwable tr) {
		if (logLevel <= Log.ERROR) {
			Log.e(tag, msg, tr);
		}
	}

	public static void d(String tag, String msg) {
		if (logLevel <= Log.DEBUG) {
			Log.d(tag, msg);
		}
	}

	public static void d(String tag, String msg, Throwable tr) {
		if (logLevel <= Log.DEBUG) {
			Log.d(tag, msg, tr);
		}
	}

	public static void v(String tag, String msg) {
		if (logLevel <= Log.VERBOSE) {
			Log.v(tag, msg);
		}
	}

	public static void v(String tag, String msg, Throwable tr) {
		if (logLevel <= Log.VERBOSE) {
			Log.v(tag, msg, tr);
		}
	}

	public static void i(String tag, String msg) {
		if (logLevel <= Log.INFO) {
			Log.i(tag, msg);
		}
	}

	public static void i(String tag, String msg, Throwable tr) {
		if (logLevel <= Log.INFO) {
			Log.i(tag, msg, tr);
		}
	}

	public static void w(String tag, String msg) {
		if (logLevel <= Log.WARN) {
			Log.i(tag, msg);
		}
	}

	public static void w(String tag, String msg, Throwable tr) {
		if (logLevel <= Log.WARN) {
			Log.i(tag, msg, tr);
		}
	}

	public static boolean isLoggable(String tag, int level) {
		return logLevel <= level;
	}
}
